Put the trash icon on the right for LTR locales, or on the left for RTL.
authorFederico Mena Quintero <federico@ximian.com>
Fri, 12 Mar 2004 00:03:48 +0000 (00:03 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Fri, 12 Mar 2004 00:03:48 +0000 (00:03 +0000)
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
Put the trash icon on the right for LTR locales, or on the left
for RTL.
(shortcuts_drag_motion_cb): Cancel the idle handler here as well.
(shortcuts_drag_leave_cb): Test whether the idle is present.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 662d56a5178f9ca15217b61110cbe55258c6099b..0b69b6498fed05fb34a7b65c40d13198769647ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
+       Put the trash icon on the right for LTR locales, or on the left
+       for RTL.
+       (shortcuts_drag_motion_cb): Cancel the idle handler here as well.
+       (shortcuts_drag_leave_cb): Test whether the idle is present.
+
 Thu Mar 11 17:51:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * modules/input/gtkimcontextxim.c (preedit_done_callback):
index 662d56a5178f9ca15217b61110cbe55258c6099b..0b69b6498fed05fb34a7b65c40d13198769647ad 100644 (file)
@@ -1,3 +1,11 @@
+2004-03-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
+       Put the trash icon on the right for LTR locales, or on the left
+       for RTL.
+       (shortcuts_drag_motion_cb): Cancel the idle handler here as well.
+       (shortcuts_drag_leave_cb): Test whether the idle is present.
+
 Thu Mar 11 17:51:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * modules/input/gtkimcontextxim.c (preedit_done_callback):
index 662d56a5178f9ca15217b61110cbe55258c6099b..0b69b6498fed05fb34a7b65c40d13198769647ad 100644 (file)
@@ -1,3 +1,11 @@
+2004-03-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
+       Put the trash icon on the right for LTR locales, or on the left
+       for RTL.
+       (shortcuts_drag_motion_cb): Cancel the idle handler here as well.
+       (shortcuts_drag_leave_cb): Test whether the idle is present.
+
 Thu Mar 11 17:51:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * modules/input/gtkimcontextxim.c (preedit_done_callback):
index 662d56a5178f9ca15217b61110cbe55258c6099b..0b69b6498fed05fb34a7b65c40d13198769647ad 100644 (file)
@@ -1,3 +1,11 @@
+2004-03-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
+       Put the trash icon on the right for LTR locales, or on the left
+       for RTL.
+       (shortcuts_drag_motion_cb): Cancel the idle handler here as well.
+       (shortcuts_drag_leave_cb): Test whether the idle is present.
+
 Thu Mar 11 17:51:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * modules/input/gtkimcontextxim.c (preedit_done_callback):
index 662d56a5178f9ca15217b61110cbe55258c6099b..0b69b6498fed05fb34a7b65c40d13198769647ad 100644 (file)
@@ -1,3 +1,11 @@
+2004-03-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
+       Put the trash icon on the right for LTR locales, or on the left
+       for RTL.
+       (shortcuts_drag_motion_cb): Cancel the idle handler here as well.
+       (shortcuts_drag_leave_cb): Test whether the idle is present.
+
 Thu Mar 11 17:51:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * modules/input/gtkimcontextxim.c (preedit_done_callback):
index b89a12aa32cdf3e1e297b66cd413338b22246097..d25577781fe7b04b861ee26a764ca6fe7c1f5769 100644 (file)
@@ -1881,7 +1881,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl,
          int row_pixmap_width, row_pixmap_height;
          int pixbuf_width, pixbuf_height;
          int composite_width, composite_height;
-         int pixbuf_y;
+         int pixbuf_x, pixbuf_y;
          GdkGC *gc, *mask_gc;
          GdkColor color;
          GdkBitmap *pixbuf_mask;
@@ -1896,6 +1896,12 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl,
          composite_height = MAX (row_pixmap_height, pixbuf_height);
 
          row_pixmap_y = (composite_height - row_pixmap_height) / 2;
+
+         if (gtk_widget_get_direction (impl->browse_shortcuts_tree_view) == GTK_TEXT_DIR_RTL)
+           pixbuf_x = 0;
+         else
+           pixbuf_x = composite_width - pixbuf_width;
+
          pixbuf_y = (composite_height - pixbuf_height) / 2;
 
          composite = gdk_pixmap_new (row_pixmap, composite_width, composite_height, -1);
@@ -1921,7 +1927,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl,
             NULL, &pixbuf_mask, 128);
          gdk_draw_drawable (mask, mask_gc, pixbuf_mask,
                             0, 0,
-                            0, pixbuf_y,
+                            pixbuf_x, pixbuf_y,
                             pixbuf_width, pixbuf_height);
          g_object_unref (pixbuf_mask);
 
@@ -1935,7 +1941,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl,
 
          gdk_draw_pixbuf (composite, gc, pixbuf,
                           0, 0,
-                          0, pixbuf_y,
+                          pixbuf_x, pixbuf_y,
                           pixbuf_width, pixbuf_height,
                           GDK_RGB_DITHER_MAX,
                           0, 0);
@@ -1993,10 +1999,8 @@ shortcuts_drag_leave_cb (GtkWidget             *widget,
                         guint                  time_,
                         GtkFileChooserDefault *impl)
 {
-  if (gtk_drag_get_source_widget (context) == widget)
+  if (gtk_drag_get_source_widget (context) == widget && !impl->shortcuts_drag_outside_idle)
     {
-      g_assert (impl->shortcuts_drag_outside_idle == NULL);
-
       impl->shortcuts_drag_outside_idle = g_idle_source_new ();
       g_source_set_closure (impl->shortcuts_drag_outside_idle,
                            g_cclosure_new_object (G_CALLBACK (shortcuts_drag_outside_idle_cb),
@@ -2085,12 +2089,15 @@ shortcuts_drag_motion_cb (GtkWidget             *widget,
   GtkTreeViewDropPosition pos;
   GdkDragAction action;
 
-  if (gtk_drag_get_source_widget (context) == widget && impl->shortcuts_drag_outside)
+  if (gtk_drag_get_source_widget (context) == widget)
     {
-      g_assert (impl->shortcuts_drag_outside_idle == NULL);
+      shortcuts_cancel_drag_outside_idle (impl);
 
-      shortcuts_drag_set_delete_cursor (impl, FALSE);
-      impl->shortcuts_drag_outside = FALSE;
+      if (impl->shortcuts_drag_outside)
+       {
+         shortcuts_drag_set_delete_cursor (impl, FALSE);
+         impl->shortcuts_drag_outside = FALSE;
+       }
     }
 
   if (context->suggested_action == GDK_ACTION_COPY || (context->actions & GDK_ACTION_COPY) != 0)
@@ -2277,6 +2284,7 @@ shortcuts_drag_data_received_cb (GtkWidget          *widget,
   int bookmarks_index;
 
   impl = GTK_FILE_CHOOSER_DEFAULT (data);
+  g_assert (impl->shortcuts_drag_outside_idle == NULL);
 
   /* Compute position */